Leetcode 271. Encode and Decode Strings. Python (Easy)